﻿<%@ Page Title="Data Upload" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="DataUpload.aspx.cs" Inherits="TestJQGrid.DataUpload" %>

<%@ Register Assembly="Trirand.Web" TagPrefix="trirand" Namespace="Trirand.Web.UI.WebControls" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <title></title>
    <!-- The jQuery UI theme that will be used by the grid -->
    <link rel="stylesheet" type="text/css" media="screen" href="../themes/redmond/jquery-ui-1.8.2.custom.css" />
    <!-- The jQuery UI theme extension jqGrid needs -->
    <link rel="stylesheet" type="text/css" media="screen" href="../themes/ui.jqgrid.css" />
    <!-- jQuery runtime minified -->
    <script src="../js/jquery-1.4.4.min.js" type="text/javascript"></script>
    <!-- The localization file we need, English in this case -->
    <script src="../js/trirand/i18n/grid.locale-en.js" type="text/javascript"></script>
    <!-- The jqGrid client-side javascript -->
    <script src="../js/trirand/jquery.jqGrid.min.js" type="text/javascript"></script>
    <script src="../js/trirand/jquery.jqDatePicker.min.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" media="screen" href="/Styles/ajaxTabStyleSheet.css" />
    <style type="text/css">
        .style3
        {
            width: 328px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table style="width: 100%;">
        <tr>
            <td>
                <table style="width: 100%;" border="1">
                    <tr>
                        <td align="center" valign="middle" class="style3">
                            &nbsp;<asp:Label ID="LabelProduct" runat="server" Enabled="False" Font-Bold="true"
                                Font-Size="Medium" Text="Sales Data"></asp:Label>
                        </td>
                        <td align="left" valign="top">
                            &nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:FileUpload ID="FileUpload1" runat="server" Width="350px"></asp:FileUpload>
                            <br />
                            &nbsp;&nbsp;&nbsp;
                            <asp:Label ID="Label2" runat="server" Text="Delimiter" ForeColor="Black"></asp:Label>
                            &nbsp;
                            <asp:DropDownList ID="SeperatorDDL" runat="server">
                                <asp:ListItem Value="," Selected="True">,</asp:ListItem>
                                <asp:ListItem Value="|">|</asp:ListItem>
                                <asp:ListItem Value="@">@</asp:ListItem>
                            </asp:DropDownList>
                            <asp:Button ID="ButtonViewData" runat="server" Text="View Data" OnClick="ButtonViewData_Click" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" align="left" valign="top" style="height:350px;">
                            <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="1" CssClass="ajax__tab_yuitabview-theme"
                                Width="100%" ScrollBars="Both">
                                <cc1:TabPanel ID="TabUpload" runat="server" HeaderText="Upload Data">
                                    <ContentTemplate>
                                        <trirand:JQGrid ID="JQGridInput" runat="server" Width="890px" Height="300px" OnDataRequesting="JQGridInput_DataRequesting">
                                            <Columns>
                                                <trirand:JQGridColumn DataField="TransId" PrimaryKey="True" />
                                                <trirand:JQGridColumn DataField="AgentId" />
                                                <trirand:JQGridColumn DataField="TransDate" />
                                                <trirand:JQGridColumn DataField="CarValue" />
                                                <trirand:JQGridColumn DataField="CityCode" />
                                                <trirand:JQGridColumn DataField="IntRate" />
                                                <trirand:JQGridColumn DataField="Model" />
                                                <trirand:JQGridColumn DataField="Scheme" />
                                                <trirand:JQGridColumn DataField="Manufacturer" />
                                                <trirand:JQGridColumn DataField="CarType" />
                                                <trirand:JQGridColumn DataField="Tenure" />
                                                <trirand:JQGridColumn DataField="Description" />
                                                <trirand:JQGridColumn DataField="LoanAmount" />
                                            </Columns>
                                            <SearchDialogSettings MultipleSearch="True" />
                                            <ToolBarSettings ShowRefreshButton="True" ShowSearchButton="True" />
                                            <SortSettings InitialSortColumn="TransId" />
                                            <AppearanceSettings ShowRowNumbers="True" ShrinkToFit="false"  />
                                        </trirand:JQGrid>
                                    </ContentTemplate>
                                </cc1:TabPanel>
                                <cc1:TabPanel ID="TabReject" runat="server" HeaderText="Rejected Data">
                                    <ContentTemplate>
                                        <trirand:JQGrid ID="JQGridRejected" runat="server" Width="890px" Height="300px" OnDataRequesting="JQGridRejected_DataRequesting">
                                            <Columns>
                                                <trirand:JQGridColumn DataField="TransId" PrimaryKey="True" />
                                                <trirand:JQGridColumn DataField="AgentId" />
                                                <trirand:JQGridColumn DataField="TransDate" />
                                                <trirand:JQGridColumn DataField="CarValue" />
                                                <trirand:JQGridColumn DataField="CityCode" />
                                                <trirand:JQGridColumn DataField="IntRate" />
                                                <trirand:JQGridColumn DataField="Model" />
                                                <trirand:JQGridColumn DataField="Scheme" />
                                                <trirand:JQGridColumn DataField="Manufacturer" />
                                                <trirand:JQGridColumn DataField="CarType" />
                                                <trirand:JQGridColumn DataField="Tenure" />
                                                <trirand:JQGridColumn DataField="Description" />
                                                <trirand:JQGridColumn DataField="LoanAmount" />
                                            </Columns>
                                            <SearchDialogSettings MultipleSearch="True" />
                                            <ToolBarSettings ShowRefreshButton="True" ShowSearchButton="True" />
                                            <SortSettings InitialSortColumn="TransId" />
                                            <AppearanceSettings ShowRowNumbers="True" ShrinkToFit="false" />
                                        </trirand:JQGrid>
                                    </ContentTemplate>
                                </cc1:TabPanel>
                                <cc1:TabPanel ID="TabError" runat="server" HeaderText="Data Error">
                                    <ContentTemplate>
                                        <trirand:JQGrid ID="JQGridErrors" runat="server" Width="890px" Height="300px" OnDataRequesting="JQGridErrors_DataRequesting">
                                            <Columns>
                                                <trirand:JQGridColumn Width="100" DataField="LineNumber" DataType="Int" PrimaryKey="True" />
                                                <trirand:JQGridColumn Width="500" DataField="LineString" DataType="String" />
                                                <trirand:JQGridColumn Width="1000" DataField="ErrorDescription" DataType="String" />
                                            </Columns>
                                            <SearchDialogSettings MultipleSearch="True" />
                                            <ToolBarSettings ShowRefreshButton="True" ShowSearchButton="True" />
                                            <SortSettings InitialSortColumn="LineNumber" />
                                            <AppearanceSettings ShowRowNumbers="True" ShrinkToFit="false" />
                                        </trirand:JQGrid>
                                    </ContentTemplate>
                                </cc1:TabPanel>
                            </cc1:TabContainer>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr align="center" valign="middle">
            <td>
                <asp:Button ID="ErrorButton" runat="server" OnClick="ErrorButton_Click" Text="Download Error/s" />
                <asp:Button ID="UploadButton" runat="server" Enabled="False" OnClick="UploadButton_Click"
                    Text="Upload to DataBase" />
                <asp:Button ID="ResetButton" runat="server" OnClick="ResetButton_Click" Text="Reset Page" />
            </td>
        </tr>
    </table>
</asp:Content>
